﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <style>
        .el-dialog__body {
            height: 100% !important;
        }

            .el-dialog__body iframe {
                height: 90% !important;
            }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

        .el-dialog__wrapper {
            position: absolute !important;
        }

        .el-dialog {
            width: 100% !important;
            height: 100% !important;
            margin: 0 !important;
        }
    </style>
</head>
<body>
    <div id="app" v-cloak>
        <el-form ref="form" :inline="true" label-position="right" label-width="100px" :model="formInline" class="demo-form-inline" style="margin-bottom: 15px;">
            <el-row>
                <el-col>
                    <div class="head-tool">
                        <el-button type="primary" @click="onSubmit">{{col.btnSelect}}</el-button>
                        <el-button type="primary" @click="onConfirm">{{col.btnConfirm}}</el-button>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.confirmationCardNumber" placeholder="编号" size="mini">
                                <template slot="prepend">
                                    编号
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
        </el-form>

        <el-table stripe ref="table" highlight-current-row @current-change="tableHandleCurrentChange"
                  :data="ListItem.tableData" :row-key="getRowKeys" :height="ListItem.tableHeight" border
                  @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%;">
            <!--<el-table-column type="selection" style="
                padding-top: 0px;
                padding-bottom: 0px;
            " align="center" width="55" :reserve-selection="true">
                        </el-table-column>-->
            <el-table-column prop="confirmationCardNumber" label="JSA编号" min-width="110">
            </el-table-column>
            <el-table-column prop="jobContent" label="工作描述" min-width="110">
            </el-table-column>

        </el-table>

    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //表单内容
                ListItem: ListItem,
                currSeelctRow: null,
                formInline: {
                    model: {
                        confirmationCardNumber: null
                    },
                    offset: 0,
                    limit: 10
                }
            },
            mounted: function () {
                //列表高度自适应
                tablehigh(this);
                this.GetPageData(1);
            },
            methods: {
                onConfirm: function () {
                    if (this.currSeelctRow)
                        parent.app.Form.securityCardCode = this.currSeelctRow.confirmationCardNumber;
                    parent.app.dialogVisible = false;
                },
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },

                //获取分页数据
                GetPageData: function (currentIndex) {
                    GetPageData(this, currentIndex, '/api/ZY_SafetyCard/GetList')
                },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //table选中行handle
                tableHandleCurrentChange: function (currentRow) {
                    this.currSeelctRow = currentRow;
                },
            }
        });
    </script>
</body>

</html>